<template>
	<view>
		<!-- 回复评论弹出层 -->
		<u-popup :show="plshow" :round="10" mode="center" @close="plclose">
			<view class="mainpadding">
				<textarea rows="10" maxlength="100" placeholder="请输入回复内容..." v-model="huifu"></textarea>
			</view>
			<view class="flexbetween">
				<view class="qxbtn" @click="plclose">取消</view>
				<view class="hfbtn" @click="addpl">回复</view>
			</view>
		</u-popup>
		<!-- 转发弹出层 -->
		<u-popup :show="forward" :round="10" mode="center" @close="fwclose">
			<view class="popupbox">
				<image :src="imageaaa" mode="" style="width: 100%;border-radius: 20rpx;"></image>
			</view>
			<view class="posiabso_box flexcolumn">
				<view class="share"></view>
				<view class="margin_top">长按保存</view>
			</view>
		</u-popup>
		<!--我要评论弹出层  -->
		<u-popup :show="wyplshow" :round="10" mode="center" @close="wyplclose">
			<view class="mainpadding">
				<textarea rows="10" maxlength="200" placeholder="填写评论内容,200字以内" v-model="huifu"></textarea>
			</view>
			<view class="flexbetween">
				<view class="qxbtn" @click="wyplclose">取消</view>
				<view class="hfbtn" @click="addpl">回复</view>
			</view>
		</u-popup>
		<!--点击三个点弹出层的内容 -->
		<u-popup :show="allshow" :round="10" mode="bottom" @close="allclose">
			<view class="xiabianju">
				<view class="mainpadding flexbetween">
					<view class="konghezi"></view>
					<view class="textcenter bighuisetext overflow_hidden">@{{ username + '：' + content}}</view>
					<view class="nostrongtext konghezi" @click="allclose">取消</view>
				</view>
				<view class="xiabiank margin_top">
					<view class="nobigtext textcenter" @click="allhuifu">回复</view>
				</view>
				<view class="xiabiank margin_top">
					<view class="nobigtext textcenter" @click="ctrlc">复制</view>
				</view>
				<view class="margin_top">
					<view class="nobigtext textcenter" @click="pljubao">举报</view>
				</view>
			</view>
		</u-popup>
		<!-- 查看联系人弹出层 -->
		<!-- <u-popup :show="lxshow" mode="center" @close="lxclose" @open="lxopen">
			<view class="tanchuc ffffff  mainpadding">
				<view class="titletext" style="text-align: center;">
					{{jishixq.type=='mobile'?'联系人电话':jishixq.type=='qq'?'QQ':'微信'}}
				</view>
				<view class="titletext dashangj">{{jishixq.account}}</view>
				<view class="lvsetext" @tap="fuzhiwenebn">点击复制</view>
				<view class="huisetext dingwei" @click="lxqx">取消</view>
			</view>
		</u-popup> -->
		<!-- 选择置顶时间 -->
		<u-picker @cancel="zdshow=false" @confirm="zdconfirm" keyName="name" :show="zdshow" :columns="zdcolumns"
			title="选择置顶时间" confirmColor="#2ACC9C"></u-picker>
		<!-- 内容 -->
		<view class="neirong">
			<!-- 个人信息 -->
			<view :class="jishixq.check_status==4?'block1 bgakground-posi':'block1'">
				<view class="flexbetween mainpadding">
					<view class="flexleft">
						<view class="gerentx">
							<image :src="jishixq.user['avatar']" mode=""></image>
						</view>
						<view class="txt titletext">{{jishixq.username}}</view>
					</view>
					<view class="honsetext" @click="tzjb">举报</view>
				</view>
				<view class="txt nostrongtext mainpadding2">
					<text>{{jishixq.name + " " + jishixq.content.replace(/[\r\n]/g, "")}}</text>
				</view>
				<view class="flexleft mainpadding2">
					<view class="gerentuzs radius margin_top2" v-for="(item,index) in jishixq.images" :key="index">
						<image class="radius" :src="item" mode="" @click="preview(item)"></image>
					</view>
				</view>
				<view class="flexleft mainpadding2">
					<view class="littletxt lablecolor margin_right3">#{{jishixq.topic.name}}</view>
					<view class="littletxt smalltext margin_right3">{{jishixq.createtime_text}}</view>
					<view class="huisetext" style="font-size: 28rpx;">{{jishixq.view_count}}人围观</view>
				</view>
				<view class="flexcenter">
					<view class="flexcenter sanashi" @click="share">
						<view class="fenxiang"></view>
						<view class="nostrongtext">分享</view>
					</view>
					<view class="bdbox flexcenter sanashi" @click="xzzdsj">
						<view class="bangding"></view>
						<view class="nostrongtext margin_right3">帮顶</view>
					</view>
					<view class="zanbox flexcenter sanashi" @click="jsdianzan(jishixq.id)">
						<view v-show="jishixq.is_fav_count==0" class="zans"></view>
						<view v-show="jishixq.is_fav_count==1" class="zan"></view>
						<view v-show="jishixq.is_fav_count==1" class="huangsetext">{{jishixq.fav_count}}
						</view>
						<view v-show="jishixq.is_fav_count==0" class="huisetext">
							{{jishixq.fav_count==0?'点赞':jishixq.fav_count}}
						</view>
					</view>
				</view>
				<view class="chakanlxfs margin_top" @click="cklxfs">查看联系方式</view>
				<!-- 联系方式 -->
				<view class="mainpadding xiabiank" v-show="lxshow && jishixq.check_status!=4">
					<view class="nostrongtext">联系人：{{jishixq.username}}</view>
					<view class="flexleft margin_top2">
						<view class="nostrongtext margin_right2" v-show="jishixq.mobile">手机号：{{jishixq.mobile}}</view>
						<view class="dianhua" @click="phone(jishixq.mobile)" v-show="jishixq.mobile"></view>
					</view>
					<view class="nostrongtext margin_top2" v-show="jishixq.qq">QQ：{{jishixq.qq}}</view>
					<view class="nostrongtext margin_top2" v-show="jishixq.weixin">微信：{{jishixq.weixin}}</view>
					<view class="bighuisetext margin_top2">联系我时，请告知是在校园集市上看到的。请勿提前网络转账。线下交易，自行沟通，自行承担责任。</view>
				</view>
				<view class="mainpadding xiabiank" v-show="lxshow && jishixq.check_status==4">
					<view class="nostrongtext">联系人：***</view>
					<view class="flexleft margin_top2">
						<view class="nostrongtext margin_right2">手机号：******</view>
					</view>
					<view class="nostrongtext margin_top2">QQ：******</view>
					<view class="nostrongtext margin_top2">微信：******</view>
					<view class="bighuisetext margin_top2">联系我时，请告知是在校园集市上看到的。请勿提前网络转账。线下交易，自行沟通，自行承担责任。</view>
				</view>
				<view class="gzgzh margin_top2 xiabiank" v-show="jishixq.subscribe != 1">
					<view class="nostrongtext textcenter">请先关注校园管家集市公众号</view>
					<view class="erweima">
						<image :src="jishixq.wxpublic_code" mode="" @click="preview(jishixq.wxpublic_code)"></image>
					</view>
				</view>
				<!-- 广告 -->
				<view class="flexbetween mainpadding xiabiank">
					<!-- <view class="leftbox">
						<view class="notitletext">校园集市</view>
						<view class="nostrongtext shiwu">加小助手好友，进集市微信群</view>
						<view class="nostrongtext shiwu">实时获取社区新状态</view>
					</view>
					<view class="erweima">
						<image src="../../static/image/system/shili.png" mode=""></image>
					</view> -->
					<view class="guanggao radius" @click="guanggao">
						<image class="radius" :src="guanggaoobj?guanggaoobj.thumb_image:'http://xiaoyuanjishi.yuntaiqi.com/uploads/20220902/5ae432e16946580202baa247b0b2030e.jpg'"></image>
					</view>
				</view>
				
			</view>
			<!-- 评论 -->
			<view class="block2 mainpadding">
				<!-- <view class="notitletext">评论（{{list.data.length}}）</view> -->
				<view class="flexbetween">
					<view class="notitletext">评论留言</view>
					<view class="flexright" @click="wypinglun">
						<view class="bighuisetext margin_right1">我要评论</view>
						<view class="rticon"></view>
					</view>
				</view>
				<view class="pinlunbox margin_top" :id="'md'+item.id" v-for="(item,index) in list.data" :key="item.id">
					<view class="flexbetween">
						<view class="flexleft">
							<view class="tupian margin_right2">
								<image class="radius" :src="item.user.avatar" mode=""></image>
							</view>
							<view class="notitletext margin_right2">{{item.user.nickname}}</view>
							<view class="zuozebtn" v-show="item.user.id===jishixq.user.id">作者</view>
						</view>
						<view class="flexleft" @click="pjdianzan(item)">
							<view v-show="item.is_fav_count==0" class="zans"></view>
							<view v-show="item.is_fav_count==1" class="zan"></view>
							<view v-show="item.is_fav_count==1" class="huangsetext">{{item.fav_count}}
							</view>
							<view v-show="item.is_fav_count==0" class="huisetext">
								{{item.fav_count==0?'点赞':item.fav_count}}
							</view>
						</view>
					</view>
					<view class="notitletext dabianju" @click="tuancpj(item.id)">{{item.content}}</view>
					<view class="flexbetween dabianju">
						<view class="huisetext">{{item.createtime_text}}</view>
						<view class="dians" @click="sangedian(item)"></view>
					</view>
					<!-- 多个评价 -->
					<view class="allpj" v-if="flag">
						<view class="zidingyi1" v-show="item.jpp" v-for="ite in item.forum_comment" :key="ite.id">
							<view class="zidingyi2 flexleft">
								<view class="smalltupian margin_right2">
									<image :src="ite.user.avatar" mode=""></image>
								</view>
								<view class="flexbetween needeity">
									<view class="flexleft">
										<view class="notitletext margin_right2">{{ite.user.nickname}}</view>
										<view class="zuozebtn margin_right2" v-show="ite.user.id===jishixq.user.id">作者
										</view>
										<view class="huisetext">{{ite.createtime_text}}</view>
									</view>
									<view class="flexleft" @click="pjzjdianzan(ite)">
										<view v-show="ite.is_fav_count==0" class="zans"></view>
										<view v-show="ite.is_fav_count==1" class="zan"></view>
										<view v-show="ite.is_fav_count==1" class="huangsetext">{{ite.fav_count}}
										</view>
										<view v-show="ite.is_fav_count==0" class="huisetext">
											{{ite.fav_count==0?'点赞':ite.fav_count}}
										</view>
									</view>
								</view>
							</view>
							<view class="notitletext dabianju" @click="tuancpj(ite.id)">回复<text
									class="greencolor">@{{ite.puser.nickname}}</text>：{{ite.content}}</view>
						</view>
					</view>
					<view class="flexcenter margin_top" @click="zhangkai(index)" v-if="item.forum_comment.length!=0">
						<view class="nostrongtext" v-show="!item.jpp">展开评论</view>
						<view class="nostrongtext" v-show="item.jpp">收起评论</view>
						<view class="zhaiktb" v-show="!item.jpp"></view>
						<view class="shouqi" v-show="item.jpp"></view>
					</view>
				</view>
			</view>
		</view>
		<!-- <uqrcode ref="qrcode" canvas-id="qrcode" size="0" :value="urlhref"></uqrcode> -->
		
		<!-- 转发内容 -->
		<view class="popupbox" ref="viewimage" v-show="forward">
		<!-- <view class="popupbox" ref="viewimage"> -->
			<view class="nostrongtext mainpadding">
				<text class="imgtxt">{{jishixq.name + " " + jishixq.content.replace(/[\r\n]/g, "")}}</text>
			</view>
			<view class="flexleft mainpadding2 ">
				<view class="gerentuzs radius" v-for="(item,index) in jishixq.images" :key="index">
					<image class="radius" :src="item" mode=""></image>
				</view>
			</view>
			<view class="mainpadding2 padding_bottom flexbetween">
				<view class="lablecolor margin_right3">#{{jishixq.topic.name}}</view>
				<view class="huisetext">{{jishixq.view_count}}人围观</view>
			</view>
			<view class="flexleft mainpadding">
				<view class="erweima" style="margin :0 30rpx 0 0 ">
					<!-- <img :src="base_code" alt=""> -->
					<uqrcode ref="qrcode" canvas-id="qrcode" size="60" :value="urlhref"></uqrcode>
				</view>
				<view>
					<view class="notitletext">长按识别二维码</view>
					<view class="nostrongtext margin_top2">参与贴子互动，发布新帖子</view>
				</view>
			</view>
			<view class="mainpadding2">
				<view class="titletext" style="font-size: 36rpx;">校园管家集市</view>
				<view class="strongtext margin_top">上万同学在线交流</view>
			</view>
		</view>
		<!-- 固定内容 -->
		<replacebtn :info="{replace:true,news:true,jishi:true}"></replacebtn>
		<!-- 底部 -->
		<!-- <view class="gudingdibu">
			<view class="bibubox flexbetween">
				<input type="text" class="inputs" placeholder="请输入评论内容" v-model="msg">
				<view class="fsabubtn" @click="fabupj">发布</view>
			</view>
		</view> -->
		<view class="gudingdibu" @click="jump">
			<view class="jiacutext textcenter">校园管家集市</view>
			<view class="nojiacutext margin_top1 textcenter">提供技术支持</view>
		</view>
	</view>
</template>

<script>
	import replacebtn from '../../components/replacebtn/replacebtn.vue'
	import html2canvas from 'html2canvas'
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				base_code:'',
				// 展开
				isShow: true,
				page: 1,
				limit: 12,
				list: {
					data: []
				},
				//三个点弹框
				allshow: false,
				//评论弹框
				plshow: false,
				//我要评论弹框
				wyplshow: false,
				// 分享弹框
				forward: false,
				//选择置顶时间
				zdshow: false,
				zdcolumns: [],
				// 集市详情
				jishixq: {
					user: {
						avatar: ""
					}
				},
				//查看联系方式
				lxshow: false,
				//联系人电话
				phonenum: "2121321",
				listid: "",
				//添加评价
				msg: "",
				// 回复内容
				huifu: "",
				// 评论的父级id
				pid: "",
				flag: true,
				plid: "", //评论id
				username: "",
				content: "",
				imageaaa: "",
				//二维码相关参数
				modal_qr: false,
				urlhref: '', // 要生成的二维码值
				guanggaoobj:{}, //广告图
				
			}
		},
		filters: {
			// 时间戳处理
			formatDate: function(value, spe = '/') {
				let maohao = ':'
				value = value * 1000
				let data = new Date(value);
				let year = data.getFullYear();
				let month = data.getMonth() + 1;
				let day = data.getDate();
				let h = data.getHours();
				let mm = data.getMinutes();
				let s = data.getSeconds();
				month = month >= 10 ? month : "0" + month;
				day = day >= 10 ? day : "0" + day;
				h = h >= 10 ? h : "0" + h;
				mm = mm >= 10 ? mm : "0" + mm;
				s = s >= 10 ? s : "0" + s;
				return `${month}${spe}${day}  ${h}${maohao}${mm}`;
			}
		},
		onLoad(jpp) {
			let data = JSON.parse(decodeURIComponent(jpp.idjpp));
			console.log(data);
			this.listid = data.detailid;
			this.plid = data.plid;
			// this.generateCode()
		},
		onShow() {
			this.init()
			this.listjsxq()
			this.generateCode()
			this.getbanner()
			// this.url = encodeURIComponent(window.location.href)
			console.log(this.$route.params);
		},
		methods: {
			jump(){
				uni.navigateTo({
					url:"/pages/webview/webview?url=https://www.baidu.com/"
				})
			},
			getbanner(){
				httpRequest.request('banner/lists', 'POST', {
					group:'detail_index',
				}, false, false, true).then(res => {
					console.log(res,5656);
					if(res.code == 1){
						if(res.data){
							this.guanggaoobj = res.data[0]
						}
					}
				})
			},
			preview(image){
				console.log(image)
				let arr = [];
				arr.push(image);
				uni.previewImage({
					urls:arr,
					success(res) {
						console.log(res)
					},
					fail(err) {
						console.log(err)
					}
				})
			},
			cklxfs(){
				if(this.jishixq.subscribe == 1){
					this.lxshow = true
				}else{
					httpRequest.toast('请扫描下方二维码关注公众号后查看联系方式!')
				}
			},
			generateCode(){
				this.urlhref = encodeURIComponent(window.location.href)
				
				setTimeout(()=>{
					this.$refs.uqrcode.toTempFilePath({
					  success: res => {
					    console.log(res);
						this.base_code = res.filepath
					  }
					});
				},1000)
			},
			// view盒子转化为图片
			toImage() {
				html2canvas(this.$refs.viewimage.$el).then(canvas => {
					let base64 = canvas.toDataURL("image/png");
					this.imageaaa = base64
					// console.log(this.imageaaa)
					uni.hideLoading();
				});
			},
			saveimage(image) {
				let base64 = image;
				const bitmap = new plus.nativeObj.Bitmap("base64");
				bitmap.loadBase64Data(base64, function() {
					const url = "_doc/" + new Date().getTime() + ".png";
					console.log('saveHeadImgFile', url)
					bitmap.save(url, {
						overwrite: true, // 是否覆盖
						// quality: 'quality'  // 图片清晰度
					}, (i) => {
						let down = plus.downloader.createDownload(url, {}, function(e, a) {
							plus.gallery.save(e.filename, function(e) {
								uni.showToast({
									title: "保存成功",
									mask: true,
								});
							}, function(e) {
								console.log(e, "下载失败,请重试");
							})
						});
						down.start();
						bitmap.clear()
					}, (e) => {
						uni.showToast({
							title: '图片保存失败',
							icon: 'none'
						})
						bitmap.clear()
					});
				}, (e) => {
					uni.showToast({
						title: '图片保存失败',
						icon: 'none'
					})
					bitmap.clear()
				});
			},
			// 展开全部评论
			zhangkai(index) {
				this.list.data[index].jpp = !this.list.data[index].jpp
				this.flag = false
				this.flag = true
			},
			//置顶确定,购买时间
			zdconfirm(e) {
				this.zdshow = false,
					console.log(e)
				httpRequest.request('forum/buy_minutes', 'POST', {
					forum_id: this.listid,
					minutes_id: e.value[0].id,
					platform: "wxpublic"
				}).then(res => {
					console.log(res);
					this.pay(res)
				})
			},
			// 支付
			pay(res) {
				httpRequest.request('pay/pay', 'POST', {
					type: 2,
					order_id: res.data.id,
					platform: "wxpublic"
				}, false, false, true).then(res => {
					this.hpay(res.data)
				})
			},
			// 调起微信支付
			hpay(data) {
				WeixinJSBridge.invoke('getBrandWCPayRequest', {
					"appId": data.appId, //公众号ID，由商户传入    
					"timeStamp": data.timeStamp, //时间戳，自1970年以来的秒数    
					"nonceStr": data.nonceStr, //随机串    
					"package": data.package,
					"signType": data.signType, //微信签名方式：    
					"paySign": data.paySign //微信签名
				}, function(res) {
					console.log(res, "支付信息")
					//android：支付成功、支付失败、取消支付  都能执行这个回调
					//ios：支付失败、取消支付  能执行这个回调， 支付成功不执行这个回调
					// alert('支付结果：' + res.err_msg);
					console.log('支付结果：', res.err_msg)
					if (res.err_msg == "get_brand_wcpay_request:ok") {
						// 使用以上方式判断前端返回,微信团队郑重提示：
						//res.err_msg将在用户支付成功后返回ok，但并不保证它绝对可靠。
						// alert('支付成功！');
					}
					if (res.err_msg == "get_brand_wcpay_request:cancel") {
						// alert('你已经取消支付了！');
					}
					if (res.err_msg == "get_brand_wcpay_request:fail") {
						// alert('支付失败了！');
					}
				});
			},
			// 分享
			share() {
				this.imageaaa = ""
				this.forward = true;
				// this.generateCode()
				uni.showLoading({
					title: '请稍等...'
				});
				setTimeout(()=>{
					this.$refs.qrcode.make();
				},10);
				setTimeout(() => {
					this.toImage()
				}, 1000)
			},
			//选择置顶时间
			xzzdsj() {
				// 如果用户未登录点击去登陆
				if (!httpRequest.checkIsLogin()) {
					httpRequest.doLogin();
					return false;
				}
				this.zdshow = true
				httpRequest.request('minutes/lists', 'POST', {}, false, false, true).then(res => {
					let aa = []
					aa.push(res.data)
					this.zdcolumns = aa
					// this.jbcolumns = res.data
				})
			},
			// 添加评价
			fabupj() {
				if (this.msg == "") {
					return false
				}
				httpRequest.request('forum_comment/add_comment', 'POST', {
					forum_id: this.listid,
					content: this.msg,
					// pid:""
				}, false, false, true).then(res => {
					this.msg = ""
					this.init()
				})
			},
			// 评价列表
			init(isPage, page) {
				let _this = this;
				httpRequest.request('forum_comment/lists', 'POST', {
					page: page || 1,
					pagesize: _this.limit,
					forum_id: this.listid
				}, false, false, true).then(res => {
					if (res.code == 1) {
						let resList = res.data;
						let dataList = _this.list;
						if (isPage == true) {
							_this.list.data = dataList.data.concat(resList.data);
							_this.list.data.forEach(item => {
								if (!item.jpp) {
									if (_this.plid) {
										Object.assign(item, {
											jpp: true
										})
									} else {
										Object.assign(item, {
											jpp: false
										})
									}
								}
							})
						} else {
							_this.list = resList
							_this.list.data = resList.data;
							_this.list.data.forEach(item => {
								if (!item.jpp) {
									if (_this.plid) {
										Object.assign(item, {
											jpp: true
										})
									} else {
										Object.assign(item, {
											jpp: false
										})
									}
								}
							})
						}
					}
				}).catch(err => {
					httpRequest.toast(err.msg);
				})
			},
			//集市详情
			listjsxq() {
				httpRequest.request('forum/detail', 'POST', {
					forum_id: this.listid
				}, false, false, true).then(res => {
					if(res.code == 1){
						this.jishixq = res.data
					}
					
					// if (this.plid) {
					// 	this.roll()
					// }
				})
			},

			// 滚动页面
			roll() {
				let pid = "#md" + this.plid
				uni.createSelectorQuery().select(pid).boundingClientRect(data => { //目标位置的节点，类class或者id
					// console.log("目标view的top\left\right\bottom分别是多少", data.top, data.left, data.right, data.bottom)
					uni.pageScrollTo({
						duration: 0, //过渡时间
						scrollTop: data.top, //到达目标class的top值
					})
				}).exec();
			},
			//复制文本
			fuzhiwenebn() {
				uni.setClipboardData({
					data: this.phonenum,
					success: function(res) {
						uni.getClipboardData({
							success: function(res) {
								uni.showToast({
									title: "复制成功",
									icon: 'none',
								});
							},
						});
					},
				});
			},
			phone(p) {
				uni.makePhoneCall({
					phoneNumber: p.toString()
				})
			},
			// 集市点赞
			jsdianzan(id) {
				// 如果用户未登录点击去登陆
				if (!httpRequest.checkIsLogin()) {
					httpRequest.doLogin();
					return false;
				}
				if (this.jishixq.is_fav_count == 0) {
					this.jishixq.fav_count++
					this.jishixq.is_fav_count = 1
				} else {
					this.jishixq.fav_count--
					this.jishixq.is_fav_count = 0
				}
				httpRequest.request('forum/toggle_fav', 'POST', {
					forum_id: id
				}, false, false, true).then(res => {
					// httpRequest.toast(res.msg)
					// this.listjsxq()
				})
			},
			// 评价点赞
			pjdianzan(item) {
				// 如果用户未登录点击去登陆
				if (!httpRequest.checkIsLogin()) {
					httpRequest.doLogin();
					return false;
				}
				if (item.is_fav_count == 0) {
					item.fav_count++
					item.is_fav_count = 1
				} else {
					item.fav_count--
					item.is_fav_count = 0
				}
				httpRequest.request('forum_comment/toggle_fav', 'POST', {
					forum_comment_id: item.id
				}, false, false, true).then(res => {
					// httpRequest.toast(res.msg)
					// this.init()
				})
			},
			pjzjdianzan(item) {
				// 如果用户未登录点击去登陆
				if (!httpRequest.checkIsLogin()) {
					httpRequest.doLogin();
					return false;
				}
				if (item.is_fav_count) {
					item.is_fav_count = 0
					item.fav_count--
				} else {
					item.is_fav_count = 1
					item.fav_count++
				}
				httpRequest.request('forum_comment/toggle_fav', 'POST', {
					forum_comment_id: item.id
				}, false, false, true).then(res => {
					// httpRequest.toast(res.msg)
					// this.init()
				})
			},
			//三个点弹出层
			allclose() {
				this.allshow = false
			},
			// 复制评论
			ctrlc() {
				let _this = this
				uni.setClipboardData({
					data: "@" + this.username + "：" + this.content,
					success: function(res) {
						_this.allshow = false
						uni.getClipboardData({
							success: function(res) {
								uni.showToast({
									title: "复制成功",
									icon: 'none',
								});
							},
						});
					},
				});
			},
			allhuifu() {
				this.allshow = false
				this.plshow = true
			},
			sangedian(item) {
				this.pid = item.id
				this.username = item.user.nickname
				this.content = item.content
				this.allshow = true
			},
			// 评论弹出层
			tuancpj(id) {
				this.pid = id
				this.plshow = true
			},
			plclose() {
				this.huifu = ""
				this.plshow = false
			},
			//我要评论
			wyplclose() {
				this.wyplshow = false
			},
			fwclose() {
				this.forward = false
			},
			wypinglun() {
				this.wyplshow = true
			},
			guanggao(){
				let url = this.guanggaoobj? this.guanggaoobj.minapp_url : "https://www.baidu.com/"
				uni.navigateTo({
					url:"/pages/webview/webview?url="+url
				})
			},
			// 回复评论
			addpl() {
				// 如果用户未登录点击去登陆
				if (!httpRequest.checkIsLogin()) {
					httpRequest.doLogin();
					return false;
				}
				if (this.huifu == "") {
					httpRequest.toast("请输入回复内容")
					return false
				}
				httpRequest.request('forum_comment/add_comment', 'POST', {
					forum_id: this.listid,
					content: this.huifu,
					pid: this.pid
				}, false, false, true).then(res => {
					this.huifu = ""
					this.init()
					httpRequest.toast(res.msg)
					this.plshow = false
				})
			},
			//查看联系人
			// lxopen() {
			// 	// console.log('open');
			// },
			// lxclose() {
			// 	this.lxshow = false
			// 	// console.log('close');
			// },
			// lxqx() {
			// 	this.lxshow = false
			// },
			//跳转举报页面
			tzjb() {
				// 如果用户未登录点击去登陆
				if (!httpRequest.checkIsLogin()) {
					httpRequest.doLogin();
					return false;
				}
				uni.navigateTo({
					url: '/pages/jishi/jubao?jishiid=' + this.listid
				})
			},
			pljubao() {
				// 如果用户未登录点击去登陆
				if (!httpRequest.checkIsLogin()) {
					httpRequest.doLogin();
					return false;
				}
				uni.navigateTo({
					url: '/pages/jishi/jubao?jishiid=' + this.pid
				})
			}

		}
	}
</script>
<style lang="scss" scoped>
	.overflow_hidden {
		max-width: 350rpx;
		overflow: hidden;
		/* 限制一行显示 */
		white-space: nowrap;
		/* 显示不下省略号显示 */
		text-overflow: ellipsis;
		text-align: center;
	}

	.konghezi {
		width: 50rpx;

	}

	.zidingyi1 {
		padding: 0 30rpx 30rpx;
	}

	.zidingyi2 {
		padding: 30rpx 0 0;
	}

	.needeity {
		width: 80%;
	}

	.nojiacutext {
		font-size: 30rpx;
		font-family: MicrosoftYaHei-, MicrosoftYaHei;
		font-weight: normal;
		color: #999999;
	}

	.jiacutext {
		font-size: 30rpx;
		font-family: Microsoft YaHei-Bold, Microsoft YaHei;
		font-weight: bold;
		color: #999999;
	}

	.xiabianju {
		padding-bottom: 100rpx;
	}

	.xduidw {
		position: relative;
	}

	.dians {
		width: 37.64rpx;
		height: 7.53rpx;
		background-size: 100% 100%;
		background-image: url("@/static/image/system/dian.png");
	}

	.bighuisetext {
		font-size: 24rpx;
		font-family: MicrosoftYaHei-, MicrosoftYaHei;
		font-weight: normal;
		color: #999999;
		line-height: 30rpx;
	}

	.dianhua {
		width: 35.23rpx;
		height: 35.23rpx;
		background-size: 100% 100%;
		background-image: url("@/static/image/system/dianhua.png");
	}

	.shiwu {
		margin-top: 15rpx;
	}

	.xiabiank {
		padding-bottom: 30rpx;
		border-bottom: 1rpx solid rgba(112, 112, 112, .3);
	}
	.guanggao{
		width: 100%;
		height: 200rpx;
		image{
			width: 100%;
			height: 100%;
		}
	}

	.erweima {
		margin: 10rpx auto 0;
		width: 163rpx;
		height: 163rpx;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.sanashi {
		width: 33.33%;
	}

	.fenxiang {
		margin-right: 10rpx;
		width: 22.04rpx;
		height: 19.94rpx;
		background-size: 100% 100%;
		background-image: url("@/static/image/system/fenxang.png");
	}

	.bgakground-posi {
		background-image: url("@/static/image/system/over.png");
		background-position: 90% 10%;
		background-repeat: no-repeat;
		background-size: 170rpx 140rpx;
	}

	.lablecolor {
		font-size: 20rpx;
		font-family: MicrosoftYaHei-, MicrosoftYaHei;
		font-weight: normal;
		color: #2ACC9C;
	}

	.honsetext {
		font-size: 24rpx;
		font-family: MicrosoftYaHei-, MicrosoftYaHei;
		font-weight: normal;
		color: #FF6C6C;
	}

	.shouqi {
		background-image: url('@/static/image/system/zhanksq.png');
		width: 16rpx;
		background-size: 100% 100%;
		margin-left: 10rpx;
		height: 8rpx;
	}

	.zhaiktb {
		background-image: url('@/static/image/system/zhankai.png');
		width: 16rpx;
		background-size: 100% 100%;
		margin-left: 10rpx;
		height: 8rpx;
	}
	.littletxt{
		font-size: 28rpx;
	}
	.zuozebtn {
		padding: 5rpx 10rpx;
		display: flex;
		font-size: 24rpx;
		line-height: 24rpx;
		text-align: center;
		color: #fff;
		background: #2ACC9C;
		border-radius: 10rpx;
	}

	.allpj {
		margin: 20rpx 0 0 63rpx;
		background: #fafafa;
		border-radius: 20rpx;
	}

	//底部
	.gudingdibu {
		position: fixed;
		bottom: 0;
		left: 0;
		width: 100%;
		padding: 30rpx 30rpx;
		background-color: #fff;
		box-sizing: border-box;
	}

	.bibubox {
		background: #F6F6F6;
		border-radius: 36rpx;
		height: 73rpx;
		padding-left: 30rpx;
	}

	.inputs {
		height: 73rpx;
	}
	.imgtxt{
		overflow:hidden;
		text-overflow:ellipsis; 
		-webkit-line-clamp: 2;
		line-clamp: 2;
	}

	.fsabubtn {
		font-size: 30rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		font-family: Microsoft YaHei;
		font-weight: bold;
		color: #FFFFFF;
		width: 139rpx;
		height: 73rpx;
		background: #2ACC9C;
		border-radius: 36rpx;
	}
</style>
<style lang="scss" scoped>
	// 固定内容
	.xiaoxi {
		width: 40rpx;
		margin: 30rpx auto 0;
		height: 38rpx;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.gudingbox {
		padding: 10rpx 30rpx;
		border-radius: 20rpx;
		position: fixed;
		bottom: 200rpx;
		right: 30rpx;
		background: rgba(42, 204, 156, .8);
	}

	.fabutupian {
		width: 43rpx;
		margin: auto;
		height: 40rpx;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.baisetext {
		margin-top: 10rpx;
		font-size: 24rpx;
		font-family: Microsoft YaHei;
		font-weight: bold;
		color: #FFFFFF;
	}

	.jishitupian {
		margin: 30rpx auto 0;
		width: 43rpx;
		height: 40rpx;

		image {
			width: 100%;
			height: 100%;
		}
	}
</style>
<style lang="scss" scoped>
	.qxbtn {
		border-right: none !important;
		border: 1rpx solid rgba(153, 153, 153, .5);
		border-radius: 0 0 0 20rpx;
		width: 50%;
		font-size: 36rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		color: #999999;
		padding: 40rpx 0;
		text-align: center;
	}

	.hfbtn {
		border: 1rpx solid rgba(153, 153, 153, .3);
		border-radius: 0 0 20 0rpx;
		width: 50%;
		font-size: 36rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		color: #3ACFA3;
		padding: 40rpx 0;
		text-align: center;
	}

	/deep/.u-popup__content {
		// width: 90%;
		padding-bottom: 0 !important;
	}

	/deep/.u-safe-area-inset-bottom {
		padding-bottom: 0 !important;
	}

	.lvsetext {
		text-align: center;
		font-size: 30rpx;
		font-family: Microsoft YaHei;
		font-weight: bold;
		color: #2ACC9C;
	}
	.txt{
		font-size: 32rpx;
	}
	.dashangj {
		margin: 60rpx 0;
		text-align: center;
	}

	.tanchuc {
		padding: 30rpx 200rpx;
		position: relative;
	}

	.dingwei {
		position: absolute;
		top: 30rpx;
		right: 30rpx;
	}

	.neirong {
		padding-bottom: 150rpx;
	}

	.pinlunbox {
		padding-bottom: 30rpx;
		border-bottom: 1rpx solid rgba(153, 153, 153, .1);
	}

	.huangsetext {
		font-size: 24rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		color: #FF7A21;
	}

	.dabianju {
		margin: 20rpx 0 0 100rpx;
	}

	.greencolor {
		color: #2ACC9C;
	}

	.tupian {
		width: 83rpx;
		height: 83rpx;
		border-radius: 50%;

		image {
			width: 100%;
			height: 100%;
			border-radius: 50%;
		}
	}

	.smalltupian {
		width: 66rpx;
		height: 66rpx;
		border-radius: 50%;

		image {
			width: 100%;
			height: 100%;
			border-radius: 50%;
		}
	}

	.chakanlxfs {
		text-align: center;
		font-size: 24rpx;
		text-decoration: underline #2ACC9C;
		font-family: Microsoft YaHei;
		font-weight: bold;
		text-decoration: underline;
		color: #2ACC9C;
	}

	.zan {
		width: 24rpx;
		margin-right: 10rpx;
		background-size: 100% 100%;
		background-image: url('@/static/image/system/zan.png');
		height: 24rpx;
	}

	.zans {
		width: 24rpx;
		margin-right: 10rpx;
		background-size: 100% 100%;
		background-image: url('@/static/image/system/zans.png');
		height: 24rpx;
	}

	.bangding {
		width: 22rpx;
		height: 24rpx;
		margin-right: 10rpx;
		background-size: 100% 100%;
		background-image: url('@/static/image/system/bangding.png');
	}

	.jubao {
		width: 28rpx;
		height: 24rpx;
		margin-right: 10rpx;
		background-size: 100% 100%;
		background-image: url('@/static/image/system/jubao.png');
	}

	.huisetext {
		font-size: 24rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		color: #999999;
	}

	.lvsebtn {
		width: 87rpx;
		height: 36rpx;
		font-size: 20rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		border-radius: 18rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		color: #2ACC9C;
		background: rgba(0, 232, 190, .1);
	}

	.chengsebtn {
		// width: 87rpx;
		// height: 36rpx;
		font-size: 20rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		border-radius: 18rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		color: #FEB57F;
		background: rgba(254, 181, 127, .1);
	}

	.hongsebtn {
		width: 87rpx;
		height: 36rpx;
		font-size: 20rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		border-radius: 18rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		background: rgba(253, 121, 112, .1);
		color: #FD7970;
	}

	.huangsebtn {
		width: 87rpx;
		height: 36rpx;
		font-size: 20rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		border-radius: 18rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		background: rgba(253, 209, 130, .1);
		color: #FDD182;
	}

	.huisetext {
		// width: 87rpx;
		// height: 36rpx;
		font-size: 20rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		border-radius: 18rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 20rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		color: #999999;
		// margin-top: 90rpx;
	}

	.zisebtn {
		width: 87rpx;
		height: 36rpx;
		font-size: 20rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		border-radius: 18rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		color: #5179FA;
		background: rgba(81, 121, 250, .1);
	}



	.gerentuzs:nth-child(4n) {
		margin-right: 0;
	}

	.gerentuzs {
		margin-right: 30rpx;
		width: 151rpx;
		height: 139rpx;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.padding_bottom {
		padding-bottom: 30rpx;
		border-bottom: 1rpx solid rgba(235, 235, 235, 0.6);
	}

	.popupbox {
		// flex: 1;
		width: 700rpx;
		box-sizing: border-box;
	}

	.posiabso_box {
		position: absolute;
		bottom: -100rpx;
		left: 50%;
		transform: translate(-50%, 50%);
		font-size: 30rpx;
		font-weight: bold;
		color: #fff;
	}

	.share {
		width: 92rpx;
		height: 97rpx;
		background-image: url("@/static/image/system/share.png");
		background-size: 100% 100%;
	}

	.shouhsj {
		margin-top: 10rpx;
		text-indent: 48rpx;
		font-size: 24rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		color: #333333;
		line-height: 60rpx;
	}

	.gerentx {
		width: 99rpx;
		height: 99rpx;
		border-radius: 50%;
		margin-right: 30rpx;

		image {
			width: 100%;
			height: 100%;
			border-radius: 50%;
		}
	}

	.flexleft {
		flex-wrap: wrap;
	}
</style>
